import request from "@/utils/request";
import type { WfFormVo, WfFormQuery, WfForm } from "./types";
import type { AxiosPromise } from "axios";

// 查询表单列表
export function listWfForm(query: WfFormQuery): AxiosPromise<WfFormVo[]> {
  return request({
    url: "/flowable/wfForm/list",
    method: "get",
    params: query
  });
}

// 查询表单详细
export function getWfForm(formId: string | number): AxiosPromise<WfFormVo> {
  return request({
    url: "/flowable/wfForm/" + formId,
    method: "get"
  });
}

// 新增表单
export function addWfForm(data: WfForm) {
  return request({
    url: "/flowable/wfForm",
    method: "post",
    data: data
  });
}

// 修改表单
export function updateWfForm(data: WfForm) {
  return request({
    url: "/flowable/wfForm",
    method: "put",
    data: data
  });
}

// 删除表单
export function delWfForm(formId: string | number | (string | number)[]) {
  return request({
    url: "/flowable/wfForm/" + formId,
    method: "delete"
  });
}
